#ifndef __gm_directx9_h__
#define __gm_directx9_h__


#include "IGMRenderer.h"


class GMDirectx9
{
	bool m_running;
	IDirect3D9* m_d3d9;
	D3DPRESENT_PARAMETERS m_d3dparameter;
	D3DFORMAT m_depthstencilformat;
	D3DFORMAT m_colorformat;
	D3DMULTISAMPLE_TYPE m_multisampling;
	unsigned long m_vertexprocessing;

	IDirect3DDevice9* m_d3dDevice9;


public :
	GMDirectx9( HWND hwnd );
	~GMDirectx9( void );

	bool initialize( HWND hwnd );
	bool check_renderer( void );

	bool begin_scene( unsigned long flag = ( D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER ), unsigned long bgclr = 0xFFE7E7E7, float z = 1.f, unsigned long stencil = 0 );
	void end_scene( const RECT* src = 0, const RECT* dest = 0, HWND override_wnd = 0, const RGNDATA* region = 0 );

	bool running( void ) const { return m_running; }
};

#endif